# -*- coding: utf-8 -*-
# File : toml_util.py
# Author: taoyahui
# Date : 2021/6/18
import toml


def toml_generate():
    # file_path = '/Users/taoyahui/Downloads/vulsctl/docker/config.toml'
    file_path1 = '/Users/taoyahui/Downloads/vulsctl/docker/config1.toml'
    demo_file = {'test': {'nuc01Centos7Test': {'host': '192.168.50.251', 'port': '22', 'user': 'root', 'keyPath': '/root/.ssh/id_rsa', 'scanMode': ['fast', 'offline']}}, 'servers': {'nuc02Centos7': {'host': '192.168.50.156', 'port': '22', 'user': 'root', 'keyPath': '/root/.ssh/id_rsa', 'scanMode': ['fast', 'offline']}}}

    # print(file_path)

    # file = toml.load([file_path])
    # print(file)
    with open(file_path1, 'w') as f:
        r = toml.dump(demo_file, f)
        print(r)


if __name__ == '__main__':
    toml_generate()
